package cn.tedu.spring.di;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author: Miyako
 * @Date: 2024-08-02-14:27
 * @Description:
 */
@Service
public class UserService {

    @Autowired
    UserService(UserDao uD){
        System.out.println("1");
        this.uD= uD;
    }

    @Value("注册业务")
    private String servername ;

    @Autowired
    public void setuD(UserDao uD) {
        System.out.println("2");
        this.uD = uD;
    }

    @Autowired
    private UserDao uD ;

    @Override
    public String toString() {
        return "UserService{" +
                "servername='" + servername + '\'' +
                ", uD=" + uD +
                '}';
    }


}
